import Vue from 'vue'
import VueRouter from 'vue-router'
const Login =()=>import('@/views/login')
const Layout =()=>import('@/views/layout')
//评论路由
const Pinglun =()=>import('@/views/pinglun')
//注册路由
const Zhuce =()=>import('@/views/zhuce/user')
//商家注册
const StoreZhuce =()=>import('@/views/zhuce/store')
// 发布路由
const FuBu =()=>import('@/views/fabu')
// 导入信息页
const Xinxi =()=>import('@/views/mine/xinxi')
const TieZi =()=>import('@/views/mine/tiezi')
const Commend =()=>import('@/views/mine/commend')
const ShouCang =()=>import('@/views/mine/shoucang')

//某人的信息
const HisXinxi =()=>import('@/views/mine/hisxinxi')
//帖子搜索
const Search =()=>import('@/views/search/search')
//搜索列表
const SearchList =()=>import('@/views/search/searchlist')


const Student =()=>import('@/views/login/user')
const Manage =()=>import('@/views/login/manage')
const Store =()=>import('@/views/login/store')
const Home =()=>import('@/views/layout/home')
const Menu =()=>import('@/views/layout/menu')
const User =()=>import('@/views/layout/user')

import store from '@/store'

//引入商家相关的路由
const Dish =()=>import('@/views/shangjia/MyDish')
const Mine =()=>import('@/views/shangjia/user')
const AddDish =()=>import('@/views/shangjia/addDish')


//引入管理相关路由
const GuanLogin =()=>import('@/views/guanli/login')
const StuGuanli =()=>import('@/views/guanli/stuguanli')
const ShangJia =()=>import('@/views/guanli/shangjia')
const GuanLi =()=>import('@/views/guanli/user')





Vue.use(VueRouter)


const router = new VueRouter({
  mode:'hash',
  // base:'./dist',
  routes:[
    {
        path: '/login',
        name:'beforelogin',
        component: Login,
      },
   {
       path:'/storelogin',
       name:"shangjiadenglu",
       component:Store
     },
        
    {
      path:'/managelogin',
      component:Manage
    },
    {
      path:'/studentlogin',
      component:Student
    },
    {
      path:'/stuzhuce',
      component:Zhuce
    },
    {
      path:'/stozhuce',
      component:StoreZhuce
    },
    {
      path:'/',
      component:Layout,
      redirect:'/login',
      children:[
        {
          path:'home',
          component:Home
        },
        {
          path:'menu',
          component:Menu
        },
        {
          path:'user',
          component:User
        }
      ]
    },
    {
      path: '/pinglun/:param1/:param2',
      name: 'pinglun',
      component:Pinglun
    },
    {
      path:'/fabu',
      component:FuBu
    },
    {
      path:'/MyInformation',
      component:Xinxi
    },
    {
      path:'/MyPost',
      component:TieZi
    },
    {
      path:'/MyCommend',
      component:Commend
    },
    {
      path:'/MyLove',
      component:ShouCang
    },
    {
      path:'/search',
      component:Search
    },
    {
      path:'/searchlist',
      component:SearchList
    },
    {
      path:'/hisxinxi/:param1',
      name:'hisxinxi',
      component:HisXinxi
    },
    //以下为商家相关路由
    {
      path:'/mydish',
      component:Dish
    },
    {
      path:'/mine',
      component:Mine
    },
    {
      path:'/addDish',
      component:AddDish
    },
    //以下为管理员相关路由
    {
      path:'/guanlogin',
      component:GuanLogin
    },
    {
      path:'/stuguan',
      component:StuGuanli
    },
    {
      path:'/shangguan',
      component:ShangJia
    },
    {
      path:'/guanli',
      component:GuanLi
    }
  ]
})
export default router